﻿@model SpaceNeedle.City6473.WebSite.Models.PhonesModel
@using SpaceNeedle.City6473.Web.Data.Models


@{
    Layout = "~/Views/Shared/_Layout.cshtml";

    var staticContent = ViewBag.StaticContent as WebSiteContent;
    ViewBag.Title = staticContent.Phones.PageTitle;
}

<table style="width:400px;">
    <tr>
        <th style="text-align:left">
            @staticContent.Phones.Title
        </th>
        <th style="text-align:left">
            @staticContent.Phones.Number
        </th>
        <th>

        </th>
    </tr>

    @foreach (var item in Model.Phones)
    {
        <tr>
            <td>
                @item.Title
            </td>
            <td>
                @item.Number
            </td>
            <td>
                <a href="/admin/deletephone/@item.Id" onclick="return confirm('@string.Format(staticContent.Operations.DeleteMessage, item.Title)?')" title="@staticContent.Operations.Delete" style="font-family:'Segoe UI Symbol';font-size:18px;">@Html.Raw(staticContent.Operations.DeleteSymbol)</a>
            </td>
            <td>
                <a href="/Admin/EditPhone/@item.Id" style="font-family:'Segoe UI Symbol';font-size:18px;" title="@staticContent.Operations.Edit">@Html.Raw(staticContent.Operations.EditSymbol)</a>
            </td>
        </tr>
    }

</table>

<br /><br />
<h3>@staticContent.Phones.New</h3>
@using (Html.BeginForm())
{
    @*@Html.Hidden("Id", NewPhone.Id)*@
    
    <div class="editor-label">
        @staticContent.Phones.Title
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Title, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.Title)
    </div>
    <br />

    <div class="editor-label">
        @staticContent.Phones.Number
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Number, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.Number)
    </div>
    <br />


    <br />
    <div>
        <button class="btn btn-default" type="submit" value="Create">
            @staticContent.Operations.Add
        </button>
    </div>
    
    

}


